Repository navigation
fix(shared): share the wrapped post when sharing a share post to a squad - #7392
Merged
Merged
Conversation
Sharing a share post that has no commentary to a squad opened the composer with the wrapper itself: its r/ link, "No title" and the placeholder cover. All three share-to-squad entry points (DiscussionShareRow, ShareBar and the Share modal) passed the post as is, a pattern carried over from the old CreateSharedPostModal. The API already unwraps such a post in sharePost (determineSharedPostId), so mirror that rule on the client with getPostToShare and use it to seed the composer's URL and preview. This also sends the wrapped post's id on the moderated-squad path, which passes preview.id as sharedPostId. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Sharing a share post that has no commentary to a squad opened the composer with the wrapper post itself: its own
r/link, "No title" and the placeholder cover, instead of the article it shares.Root cause
All three share-to-squad entry points (
DiscussionShareRow,ShareBarand the Share modal'sSocialShare) seeded the SmartComposer withinitialUrl: post.permalinkandpreview: post. The API already resolves a share without commentary to the post it wraps when sharing (determineSharedPostId), but the client never did. So the preview showed the empty wrapper, and the moderated-squad path sent the wrapper's id assharedPostId. The pattern came over from the oldCreateSharedPostModalwhen it was replaced by the SmartComposer in #6417.Fix
getPostToShareingraphql/posts.ts, mirroring the API rule: a share post with no title and asharedPostresolves tosharedPost; any other post resolves to itself.initialUrlandpreviewat all three entry points. Log events still reference the original post.Testing
getPostToShare.DiscussionShareRow,ShareBarandShareModalspecs: the composer opens with the wrapped post's link and title. They fail on the previous code and pass with this change.Reported internally.
@tsahimatsliah could you take a look? This touches the share-to-squad flow you moved onto the SmartComposer.
This PR was written by Smith (AI).
🤖 Generated with Claude Code
Written by Smith (AI).
Preview domain
https://fix-share-to-squad-unwrap-share.preview.app.daily.dev